package com.kucai.yifaqapp.ui.fragment.gameFragment;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.kucai.yifaqapp.R;
import com.kucai.yifaqapp.dagger.component.fragment.DaggerPCFragmentComponent;
import com.kucai.yifaqapp.dagger.module.fragment.PCFragmentMdule;
import com.kucai.yifaqapp.global.Info;
import com.kucai.yifaqapp.model.network.entity.res.ResGameDetails;
import com.kucai.yifaqapp.model.network.entity.res.ResMoney;
import com.kucai.yifaqapp.model.network.entity.res.Reskuaile8;
import com.kucai.yifaqapp.model.network.entity.res.Respcdandan;
import com.kucai.yifaqapp.model.network.entity.res.Viewbean;
import com.kucai.yifaqapp.presenter.fragment.PCFragmentPresenter;
import com.kucai.yifaqapp.ui.activity.BaseActivity;
import com.kucai.yifaqapp.ui.activity.GameDetailActivityFinal;
import com.kucai.yifaqapp.ui.fragment.BaseFragment;
import com.kucai.yifaqapp.util.DateUtils;
import com.kucai.yifaqapp.util.OnItemClickListener;
import com.kucai.yifaqapp.util.SYSOUtils;
import com.kucai.yifaqapp.util.SpUtils;
import com.kucai.yifaqapp.util.TimeTools;
import com.kucai.yifaqapp.widget.KeyBoardWeight;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

import butterknife.BindView;

/**
 * Created by Administrator on 2018/12/11.
 */

public class PCFragment extends BaseFragment<PCFragmentPresenter> {


    @BindView(R.id.pcdandan_up_tv)
    TextView pcdandanUpTv;
    @BindView(R.id.pcdandan_one)
    TextView pcdandanOne;
    @BindView(R.id.pcdandan_two)
    TextView pcdandanTwo;
    @BindView(R.id.pcdandan_three)
    TextView pcdandanThree;
    @BindView(R.id.pcdandan_four)
    TextView pcdandanFour;
    @BindView(R.id.pcdandan_fiv)
    TextView pcdandanFiv;
    @BindView(R.id.pcdandan_iv)
    LinearLayout pcdandanIv;
    @BindView(R.id.ivtext_1)
    TextView ivtext1;
    @BindView(R.id.ivtext_2)
    TextView ivtext2;
    @BindView(R.id.ivtext_3)
    TextView ivtext3;
    @BindView(R.id.ivtext_4)
    TextView ivtext4;
    @BindView(R.id.ivtext_5)
    TextView ivtext5;
    @BindView(R.id.ivtext_6)
    TextView ivtext6;
    @BindView(R.id.includ1_one9s)
    TextView includ1One9s;
    @BindView(R.id.ivtext_7)
    TextView ivtext7;
    @BindView(R.id.ivtext_8)
    TextView ivtext8;
    @BindView(R.id.putongtv)
    LinearLayout putongtv;
    @BindView(R.id.period_down_tv)
    TextView periodDownTv;
    @BindView(R.id.close_time_tv)
    TextView closeTimeTv;
    @BindView(R.id.open_time_tv)
    TextView openTimeTv;
    @BindView(R.id.titlelin)
    LinearLayout titlelin;
    @BindView(R.id.hunhebt)
    TextView hunhebt;
    @BindView(R.id.temabt)
    TextView temabt;
    @BindView(R.id.leftbtlin)
    LinearLayout leftbtlin;
    @BindView(R.id.guanyahetitle)
    TextView guanyahetitle;
    @BindView(R.id.guanyada)
    TextView guanyada;
    @BindView(R.id.guanyadas)
    TextView guanyadas;
    @BindView(R.id.guanyadalin)
    LinearLayout guanyadalin;
    @BindView(R.id.guanyaxiao)
    TextView guanyaxiao;
    @BindView(R.id.guanyaxiaos)
    TextView guanyaxiaos;
    @BindView(R.id.guanyaxiaolin)
    LinearLayout guanyaxiaolin;
    @BindView(R.id.guanyadan)
    TextView guanyadan;
    @BindView(R.id.guanyadans)
    TextView guanyadans;
    @BindView(R.id.guanyadanlin)
    LinearLayout guanyadanlin;
    @BindView(R.id.guanyashuang)
    TextView guanyashuang;
    @BindView(R.id.guanyashuangs)
    TextView guanyashuangs;
    @BindView(R.id.guanyashuanglin)
    LinearLayout guanyashuanglin;
    @BindView(R.id.guanyalong)
    TextView guanyalong;
    @BindView(R.id.guanyalongs)
    TextView guanyalongs;
    @BindView(R.id.guanyalonglin)
    LinearLayout guanyalonglin;
    @BindView(R.id.guanyahu)
    TextView guanyahu;
    @BindView(R.id.guanyahus)
    TextView guanyahus;
    @BindView(R.id.guanyahulin)
    LinearLayout guanyahulin;
    @BindView(R.id.guanyahe)
    TextView guanyahe;
    @BindView(R.id.guanyahes)
    TextView guanyahes;
    @BindView(R.id.guanyahelin)
    LinearLayout guanyahelin;
    @BindView(R.id.guanyalonghuhe)
    LinearLayout guanyalonghuhe;
    @BindView(R.id.hongbo)
    TextView hongbo;
    @BindView(R.id.hongbos)
    TextView hongbos;
    @BindView(R.id.hongbolin)
    LinearLayout hongbolin;
    @BindView(R.id.lvbo)
    TextView lvbo;
    @BindView(R.id.lvbos)
    TextView lvbos;
    @BindView(R.id.lvbolin)
    LinearLayout lvbolin;
    @BindView(R.id.lanbo)
    TextView lanbo;
    @BindView(R.id.lanbos)
    TextView lanbos;
    @BindView(R.id.lanbolin)
    LinearLayout lanbolin;
    @BindView(R.id.hunhe_lin)
    LinearLayout hunheLin;
    @BindView(R.id.includ_guanyahe_item)
    LinearLayout includGuanyaheItem;
    @BindView(R.id.tetv_0)
    TextView tetvs0;
    @BindView(R.id.temalin0)
    LinearLayout temalin0;
    @BindView(R.id.tetv_1)
    TextView tetvs1;
    @BindView(R.id.temalin1)
    LinearLayout temalin1;
    @BindView(R.id.tetv_2)
    TextView tetvs2;
    @BindView(R.id.temalin2)
    LinearLayout temalin2;
    @BindView(R.id.tetv_3)
    TextView tetvs3;
    @BindView(R.id.temalin3)
    LinearLayout temalin3;
    @BindView(R.id.tetv_4)
    TextView tetvs4;
    @BindView(R.id.temalin4)
    LinearLayout temalin4;
    @BindView(R.id.tetv_5)
    TextView tetvs5;
    @BindView(R.id.temalin5)
    LinearLayout temalin5;
    @BindView(R.id.tetv_6)
    TextView tetvs6;
    @BindView(R.id.temalin6)
    LinearLayout temalin6;
    @BindView(R.id.tetv_7)
    TextView tetvs7;
    @BindView(R.id.temalin7)
    LinearLayout temalin7;
    @BindView(R.id.tetv_8)
    TextView tetvs8;
    @BindView(R.id.temalin8)
    LinearLayout temalin8;
    @BindView(R.id.tetv_9)
    TextView tetvs9;
    @BindView(R.id.temalin9)
    LinearLayout temalin9;
    @BindView(R.id.tetv_10)
    TextView tetvs10;
    @BindView(R.id.temalin10)
    LinearLayout temalin10;
    @BindView(R.id.tetv_11)
    TextView tetvs11;
    @BindView(R.id.temalin11)
    LinearLayout temalin11;
    @BindView(R.id.tetv_12)
    TextView tetvs12;
    @BindView(R.id.temalin12)
    LinearLayout temalin12;
    @BindView(R.id.tetv_13)
    TextView tetvs13;
    @BindView(R.id.temalin13)
    LinearLayout temalin13;
    @BindView(R.id.tetv_14)
    TextView tetvs14;
    @BindView(R.id.temalin14)
    LinearLayout temalin14;
    @BindView(R.id.tetv_15)
    TextView tetvs15;
    @BindView(R.id.temalin15)
    LinearLayout temalin15;
    @BindView(R.id.tetv_16)
    TextView tetvs16;
    @BindView(R.id.temalin16)
    LinearLayout temalin16;
    @BindView(R.id.tetv_17)
    TextView tetvs17;
    @BindView(R.id.temalin17)
    LinearLayout temalin17;
    @BindView(R.id.tetv_18)
    TextView tetvs18;
    @BindView(R.id.temalin18)
    LinearLayout temalin18;
    @BindView(R.id.tetv_19)
    TextView tetvs19;
    @BindView(R.id.temalin19)
    LinearLayout temalin19;
    @BindView(R.id.tetv_20)
    TextView tetvs20;
    @BindView(R.id.temalin20)
    LinearLayout temalin20;
    @BindView(R.id.tetv_21)
    TextView tetvs21;
    @BindView(R.id.temalin21)
    LinearLayout temalin21;
    @BindView(R.id.tetv_22)
    TextView tetvs22;
    @BindView(R.id.temalin22)
    LinearLayout temalin22;
    @BindView(R.id.tetv_23)
    TextView tetvs23;
    @BindView(R.id.temalin23)
    LinearLayout temalin23;
    @BindView(R.id.tetv_24)
    TextView tetvs24;
    @BindView(R.id.temalin24)
    LinearLayout temalin24;
    @BindView(R.id.tetv_25)
    TextView tetvs25;
    @BindView(R.id.temalin25)
    LinearLayout temalin25;
    @BindView(R.id.tetv_26)
    TextView tetvs26;
    @BindView(R.id.temalin26)
    LinearLayout temalin26;
    @BindView(R.id.tetv_27)
    TextView tetvs27;
    @BindView(R.id.temalin27)
    LinearLayout temalin27;
    @BindView(R.id.tema_item)
    LinearLayout temaItem;
    @BindView(R.id.yixuanzhong)
    TextView yixuanzhong;
    @BindView(R.id.touzhued)
    EditText touzhued;
    @BindView(R.id.xiazhubt)
    Button xiazhubt;
    @BindView(R.id.chongzhibt)
    Button chongzhibt;
    @BindView(R.id.xiazhulin)
    LinearLayout xiazhulin;
    @BindView(R.id.fengpanlin)
    TextView fengpanlin;
    @BindView(R.id.kuai8_up_tv)
    TextView kuai8UpTv;
    @BindView(R.id.kuai8_one)
    TextView kuai8One;
    @BindView(R.id.kuai8_two)
    TextView kuai8Two;
    @BindView(R.id.kuai8_three)
    TextView kuai8Three;
    @BindView(R.id.kuai8_four)
    TextView kuai8Four;
    @BindView(R.id.kuai8_fiv)
    TextView kuai8Fiv;
    @BindView(R.id.kuai8_six)
    TextView kuai8Six;
    @BindView(R.id.kuai8_seven)
    TextView kuai8Seven;
    @BindView(R.id.kuai8_eight)
    TextView kuai8Eight;
    @BindView(R.id.kuai8_noon)
    TextView kuai8Noon;
    @BindView(R.id.kuai8_ten)
    TextView kuai8Ten;
    @BindView(R.id.kuai8_iv_lin)
    LinearLayout kuai8IvLin;
    @BindView(R.id.niuniu_up_tv)
    TextView niuniuUpTv;
    @BindView(R.id.kuai8_onet)
    TextView kuai8Onet;
    @BindView(R.id.kuai8_twot)
    TextView kuai8Twot;
    @BindView(R.id.kuai8_threet)
    TextView kuai8Threet;
    @BindView(R.id.kuai8_fourt)
    TextView kuai8Fourt;
    @BindView(R.id.kuai8_fivt)
    TextView kuai8Fivt;
    @BindView(R.id.kuai8_sixt)
    TextView kuai8Sixt;
    @BindView(R.id.kuai8_sevent)
    TextView kuai8Sevent;
    @BindView(R.id.kuai8_eightt)
    TextView kuai8Eightt;
    @BindView(R.id.kuai8_noont)
    TextView kuai8Noont;
    @BindView(R.id.kuai8_tent)
    TextView kuai8Tent;
    @BindView(R.id.kuai8tv)
    LinearLayout kuai8tv;
    @BindView(R.id.kuai8_liangmianbt)
    TextView kuai8Liangmianbt;
    @BindView(R.id.wuhangbt)
    TextView wuhangbt;
    @BindView(R.id.zhengma)
    TextView zhengma;
    @BindView(R.id.liangmianzonghe)
    TextView liangmianzonghe;
    @BindView(R.id.zongheda)
    TextView zongheda;
    @BindView(R.id.zonghedas)
    TextView zonghedas;
    @BindView(R.id.zonghedalin)
    LinearLayout zonghedalin;
    @BindView(R.id.zonghexiao)
    TextView zonghexiao;
    @BindView(R.id.zonghexiaos)
    TextView zonghexiaos;
    @BindView(R.id.zonghexiaolin)
    LinearLayout zonghexiaolin;
    @BindView(R.id.zonghedan)
    TextView zonghedan;
    @BindView(R.id.zonghedans)
    TextView zonghedans;
    @BindView(R.id.zonghedanlin)
    LinearLayout zonghedanlin;
    @BindView(R.id.zongheshuang)
    TextView zongheshuang;
    @BindView(R.id.zongheshuangs)
    TextView zongheshuangs;
    @BindView(R.id.zongheshuanglin)
    LinearLayout zongheshuanglin;
    @BindView(R.id.zongdadan)
    TextView zongdadan;
    @BindView(R.id.zongdadans)
    TextView zongdadans;
    @BindView(R.id.zongdadanlin)
    LinearLayout zongdadanlin;
    @BindView(R.id.zongdashuang)
    TextView zongdashuang;
    @BindView(R.id.zongdashuangs)
    TextView zongdashuangs;
    @BindView(R.id.zongdashuanglin)
    LinearLayout zongdashuanglin;
    @BindView(R.id.zongxiaodan)
    TextView zongxiaodan;
    @BindView(R.id.zongxiaodans)
    TextView zongxiaodans;
    @BindView(R.id.zongxiaodanlin)
    LinearLayout zongxiaodanlin;
    @BindView(R.id.zongxiaoshuang)
    TextView zongxiaoshuang;
    @BindView(R.id.zongxiaoshuangs)
    TextView zongxiaoshuangs;
    @BindView(R.id.zongxiaoshuanglin)
    LinearLayout zongxiaoshuanglin;
    @BindView(R.id.qianhouhetitle)
    TextView qianhouhetitle;
    @BindView(R.id.qianduo)
    TextView qianduo;
    @BindView(R.id.qianduos)
    TextView qianduos;
    @BindView(R.id.qianduolin)
    LinearLayout qianduolin;
    @BindView(R.id.houduo)
    TextView houduo;
    @BindView(R.id.houduos)
    TextView houduos;
    @BindView(R.id.houduolin)
    LinearLayout houduolin;
    @BindView(R.id.qianhouhe)
    TextView qianhouhe;
    @BindView(R.id.qianhouhes)
    TextView qianhouhes;
    @BindView(R.id.qianhouhelin)
    LinearLayout qianhouhelin;
    @BindView(R.id.qianshuanghetititle)
    TextView qianshuanghetititle;
    @BindView(R.id.danduo)
    TextView danduo;
    @BindView(R.id.danduos)
    TextView danduos;
    @BindView(R.id.danduolin)
    LinearLayout danduolin;
    @BindView(R.id.shuangduo)
    TextView shuangduo;
    @BindView(R.id.shuangduos)
    TextView shuangduos;
    @BindView(R.id.zshuangduolin)
    LinearLayout zshuangduolin;
    @BindView(R.id.danshuanghe)
    TextView danshuanghe;
    @BindView(R.id.danshuanghes)
    TextView danshuanghes;
    @BindView(R.id.danshaunghelin)
    LinearLayout danshaunghelin;
    @BindView(R.id.kuai8_liangmianlin)
    LinearLayout kuai8Liangmianlin;
    @BindView(R.id.wuhangtitle)
    TextView wuhangtitle;
    @BindView(R.id.jintv)
    TextView jintv;
    @BindView(R.id.jintvs)
    TextView jintvs;
    @BindView(R.id.jintvlin)
    LinearLayout jintvlin;
    @BindView(R.id.mutv)
    TextView mutv;
    @BindView(R.id.mutvs)
    TextView mutvs;
    @BindView(R.id.mutvlin)
    LinearLayout mutvlin;
    @BindView(R.id.shuitv)
    TextView shuitv;
    @BindView(R.id.shuitvs)
    TextView shuitvs;
    @BindView(R.id.shuitvlin)
    LinearLayout shuitvlin;
    @BindView(R.id.huotv)
    TextView huotv;
    @BindView(R.id.huotvs)
    TextView huotvs;
    @BindView(R.id.huotvlin)
    LinearLayout huotvlin;
    @BindView(R.id.tutv)
    TextView tutv;
    @BindView(R.id.tutvs)
    TextView tutvs;
    @BindView(R.id.tutvlin)
    LinearLayout tutvlin;
    @BindView(R.id.wuhang_item)
    LinearLayout wuhangItem;
    @BindView(R.id.zhengma1)
    TextView zhengma1;
    @BindView(R.id.zhengmalin1)
    LinearLayout zhengmalin1;
    @BindView(R.id.zhengma2)
    TextView zhengma2;
    @BindView(R.id.zhengmalin2)
    LinearLayout zhengmalin2;
    @BindView(R.id.zhengma3)
    TextView zhengma3;
    @BindView(R.id.zhengmalin3)
    LinearLayout zhengmalin3;
    @BindView(R.id.zhengma4)
    TextView zhengma4;
    @BindView(R.id.zhengmalin4)
    LinearLayout zhengmalin4;
    @BindView(R.id.zhengma5)
    TextView zhengma5;
    @BindView(R.id.zhengmalin5)
    LinearLayout zhengmalin5;
    @BindView(R.id.zhengma6)
    TextView zhengma6;
    @BindView(R.id.zhengmalin6)
    LinearLayout zhengmalin6;
    @BindView(R.id.zhengma7)
    TextView zhengma7;
    @BindView(R.id.zhengmalin7)
    LinearLayout zhengmalin7;
    @BindView(R.id.zhengma8)
    TextView zhengma8;
    @BindView(R.id.zhengmalin8)
    LinearLayout zhengmalin8;
    @BindView(R.id.zhengma9)
    TextView zhengma9;
    @BindView(R.id.zhengmalin9)
    LinearLayout zhengmalin9;
    @BindView(R.id.zhengma10)
    TextView zhengma10;
    @BindView(R.id.zhengmalin10)
    LinearLayout zhengmalin10;
    @BindView(R.id.zhengma11)
    TextView zhengma11;
    @BindView(R.id.zhengmalin11)
    LinearLayout zhengmalin11;
    @BindView(R.id.zhengma12)
    TextView zhengma12;
    @BindView(R.id.zhengmalin12)
    LinearLayout zhengmalin12;
    @BindView(R.id.zhengma13)
    TextView zhengma13;
    @BindView(R.id.zhengmalin13)
    LinearLayout zhengmalin13;
    @BindView(R.id.zhengma14)
    TextView zhengma14;
    @BindView(R.id.zhengmalin14)
    LinearLayout zhengmalin14;
    @BindView(R.id.zhengma15)
    TextView zhengma15;
    @BindView(R.id.zhengmalin15)
    LinearLayout zhengmalin15;
    @BindView(R.id.zhengma16)
    TextView zhengma16;
    @BindView(R.id.zhengmalin16)
    LinearLayout zhengmalin16;
    @BindView(R.id.zhengma17)
    TextView zhengma17;
    @BindView(R.id.zhengmalin17)
    LinearLayout zhengmalin17;
    @BindView(R.id.zhengma18)
    TextView zhengma18;
    @BindView(R.id.zhengmalin18)
    LinearLayout zhengmalin18;
    @BindView(R.id.zhengma19)
    TextView zhengma19;
    @BindView(R.id.zhengmalin19)
    LinearLayout zhengmalin19;
    @BindView(R.id.zhengma20)
    TextView zhengma20;
    @BindView(R.id.zhengmalin20)
    LinearLayout zhengmalin20;
    @BindView(R.id.zhengma21)
    TextView zhengma21;
    @BindView(R.id.zhengmalin21)
    LinearLayout zhengmalin21;
    @BindView(R.id.zhengma22)
    TextView zhengma22;
    @BindView(R.id.zhengmalin22)
    LinearLayout zhengmalin22;
    @BindView(R.id.zhengma23)
    TextView zhengma23;
    @BindView(R.id.zhengmalin23)
    LinearLayout zhengmalin23;
    @BindView(R.id.zhengma24)
    TextView zhengma24;
    @BindView(R.id.zhengmalin24)
    LinearLayout zhengmalin24;
    @BindView(R.id.zhengma25)
    TextView zhengma25;
    @BindView(R.id.zhengmalin25)
    LinearLayout zhengmalin25;
    @BindView(R.id.zhengma26)
    TextView zhengma26;
    @BindView(R.id.zhengmalin26)
    LinearLayout zhengmalin26;
    @BindView(R.id.zhengma27)
    TextView zhengma27;
    @BindView(R.id.zhengmalin27)
    LinearLayout zhengmalin27;
    @BindView(R.id.zhengma28)
    TextView zhengma28;
    @BindView(R.id.zhengmalin28)
    LinearLayout zhengmalin28;
    @BindView(R.id.zhengma29)
    TextView zhengma29;
    @BindView(R.id.zhengmalin29)
    LinearLayout zhengmalin29;
    @BindView(R.id.zhengma30)
    TextView zhengma30;
    @BindView(R.id.zhengmalin30)
    LinearLayout zhengmalin30;
    @BindView(R.id.zhengma31)
    TextView zhengma31;
    @BindView(R.id.zhengmalin31)
    LinearLayout zhengmalin31;
    @BindView(R.id.zhengma32)
    TextView zhengma32;
    @BindView(R.id.zhengmalin32)
    LinearLayout zhengmalin32;
    @BindView(R.id.zhengma33)
    TextView zhengma33;
    @BindView(R.id.zhengmalin33)
    LinearLayout zhengmalin33;
    @BindView(R.id.zhengma34)
    TextView zhengma34;
    @BindView(R.id.zhengmalin34)
    LinearLayout zhengmalin34;
    @BindView(R.id.zhengma35)
    TextView zhengma35;
    @BindView(R.id.zhengmalin35)
    LinearLayout zhengmalin35;
    @BindView(R.id.zhengma36)
    TextView zhengma36;
    @BindView(R.id.zhengmalin36)
    LinearLayout zhengmalin36;
    @BindView(R.id.zhengma37)
    TextView zhengma37;
    @BindView(R.id.zhengmalin37)
    LinearLayout zhengmalin37;
    @BindView(R.id.zhengma38)
    TextView zhengma38;
    @BindView(R.id.zhengmalin38)
    LinearLayout zhengmalin38;
    @BindView(R.id.zhengma39)
    TextView zhengma39;
    @BindView(R.id.zhengmalin39)
    LinearLayout zhengmalin39;
    @BindView(R.id.zhengma40)
    TextView zhengma40;
    @BindView(R.id.zhengmalin40)
    LinearLayout zhengmalin40;
    @BindView(R.id.zhengma41)
    TextView zhengma41;
    @BindView(R.id.zhengmalin41)
    LinearLayout zhengmalin41;
    @BindView(R.id.zhengma42)
    TextView zhengma42;
    @BindView(R.id.zhengmalin42)
    LinearLayout zhengmalin42;
    @BindView(R.id.zhengma43)
    TextView zhengma43;
    @BindView(R.id.zhengmalin43)
    LinearLayout zhengmalin43;
    @BindView(R.id.zhengma44)
    TextView zhengma44;
    @BindView(R.id.zhengmalin44)
    LinearLayout zhengmalin44;
    @BindView(R.id.zhengma45)
    TextView zhengma45;
    @BindView(R.id.zhengmalin45)
    LinearLayout zhengmalin45;
    @BindView(R.id.zhengma46)
    TextView zhengma46;
    @BindView(R.id.zhengmalin46)
    LinearLayout zhengmalin46;
    @BindView(R.id.zhengma47)
    TextView zhengma47;
    @BindView(R.id.zhengmalin47)
    LinearLayout zhengmalin47;
    @BindView(R.id.zhengma48)
    TextView zhengma48;
    @BindView(R.id.zhengmalin48)
    LinearLayout zhengmalin48;
    @BindView(R.id.zhengma49)
    TextView zhengma49;
    @BindView(R.id.zhengmalin49)
    LinearLayout zhengmalin49;
    @BindView(R.id.zhengma50)
    TextView zhengma50;
    @BindView(R.id.zhengmalin50)
    LinearLayout zhengmalin50;
    @BindView(R.id.zhengma51)
    TextView zhengma51;
    @BindView(R.id.zhengmalin51)
    LinearLayout zhengmalin51;
    @BindView(R.id.zhengma52)
    TextView zhengma52;
    @BindView(R.id.zhengmalin52)
    LinearLayout zhengmalin52;
    @BindView(R.id.zhengma53)
    TextView zhengma53;
    @BindView(R.id.zhengmalin53)
    LinearLayout zhengmalin53;
    @BindView(R.id.zhengma54)
    TextView zhengma54;
    @BindView(R.id.zhengmalin54)
    LinearLayout zhengmalin54;
    @BindView(R.id.zhengma55)
    TextView zhengma55;
    @BindView(R.id.zhengmalin55)
    LinearLayout zhengmalin55;
    @BindView(R.id.zhengma56)
    TextView zhengma56;
    @BindView(R.id.zhengmalin56)
    LinearLayout zhengmalin56;
    @BindView(R.id.zhengma57)
    TextView zhengma57;
    @BindView(R.id.zhengmalin57)
    LinearLayout zhengmalin57;
    @BindView(R.id.zhengma58)
    TextView zhengma58;
    @BindView(R.id.zhengmalin58)
    LinearLayout zhengmalin58;
    @BindView(R.id.zhengma59)
    TextView zhengma59;
    @BindView(R.id.zhengmalin59)
    LinearLayout zhengmalin59;
    @BindView(R.id.zhengma60)
    TextView zhengma60;
    @BindView(R.id.zhengmalin60)
    LinearLayout zhengmalin60;
    @BindView(R.id.zhengma61)
    TextView zhengma61;
    @BindView(R.id.zhengmalin61)
    LinearLayout zhengmalin61;
    @BindView(R.id.zhengma62)
    TextView zhengma62;
    @BindView(R.id.zhengmalin62)
    LinearLayout zhengmalin62;
    @BindView(R.id.zhengma63)
    TextView zhengma63;
    @BindView(R.id.zhengmalin63)
    LinearLayout zhengmalin63;
    @BindView(R.id.zhengma64)
    TextView zhengma64;
    @BindView(R.id.zhengmalin64)
    LinearLayout zhengmalin64;
    @BindView(R.id.zhengma65)
    TextView zhengma65;
    @BindView(R.id.zhengmalin65)
    LinearLayout zhengmalin65;
    @BindView(R.id.zhengma66)
    TextView zhengma66;
    @BindView(R.id.zhengmalin66)
    LinearLayout zhengmalin66;
    @BindView(R.id.zhengma67)
    TextView zhengma67;
    @BindView(R.id.zhengmalin67)
    LinearLayout zhengmalin67;
    @BindView(R.id.zhengma68)
    TextView zhengma68;
    @BindView(R.id.zhengmalin68)
    LinearLayout zhengmalin68;
    @BindView(R.id.zhengma69)
    TextView zhengma69;
    @BindView(R.id.zhengmalin69)
    LinearLayout zhengmalin69;
    @BindView(R.id.zhengma70)
    TextView zhengma70;
    @BindView(R.id.zhengmalin70)
    LinearLayout zhengmalin70;
    @BindView(R.id.zhengma71)
    TextView zhengma71;
    @BindView(R.id.zhengmalin71)
    LinearLayout zhengmalin71;
    @BindView(R.id.zhengma72)
    TextView zhengma72;
    @BindView(R.id.zhengmalin72)
    LinearLayout zhengmalin72;
    @BindView(R.id.zhengma73)
    TextView zhengma73;
    @BindView(R.id.zhengmalin73)
    LinearLayout zhengmalin73;
    @BindView(R.id.zhengma74)
    TextView zhengma74;
    @BindView(R.id.zhengmalin74)
    LinearLayout zhengmalin74;
    @BindView(R.id.zhengma75)
    TextView zhengma75;
    @BindView(R.id.zhengmalin75)
    LinearLayout zhengmalin75;
    @BindView(R.id.zhengma76)
    TextView zhengma76;
    @BindView(R.id.zhengmalin76)
    LinearLayout zhengmalin76;
    @BindView(R.id.zhengma77)
    TextView zhengma77;
    @BindView(R.id.zhengmalin77)
    LinearLayout zhengmalin77;
    @BindView(R.id.zhengma78)
    TextView zhengma78;
    @BindView(R.id.zhengmalin78)
    LinearLayout zhengmalin78;
    @BindView(R.id.zhengma79)
    TextView zhengma79;
    @BindView(R.id.zhengmalin79)
    LinearLayout zhengmalin79;
    @BindView(R.id.zhengma80)
    TextView zhengma80;
    @BindView(R.id.zhengmalin80)
    LinearLayout zhengmalin80;
    @BindView(R.id.zhengmaitem)
    LinearLayout zhengmaitem;
    @BindView(R.id.include_beijingkuaileitem)
    LinearLayout includeBeijingkuaileitem;
    @BindView(R.id.keybord)
    KeyBoardWeight keybord;
    @BindView(R.id.zhengma01)
    TextView zhengma01;
    @BindView(R.id.zhengma02)
    TextView zhengma02;
    @BindView(R.id.zhengma03)
    TextView zhengma03;
    @BindView(R.id.zhengma04)
    TextView zhengma04;
    @BindView(R.id.zhengma05)
    TextView zhengma05;
    @BindView(R.id.zhengma06)
    TextView zhengma06;
    @BindView(R.id.zhengma07)
    TextView zhengma07;
    @BindView(R.id.zhengma08)
    TextView zhengma08;
    @BindView(R.id.zhengma09)
    TextView zhengma09;
    @BindView(R.id.zhengma010)
    TextView zhengma010;
    @BindView(R.id.zhengma011)
    TextView zhengma011;
    @BindView(R.id.zhengma012)
    TextView zhengma012;
    @BindView(R.id.zhengma013)
    TextView zhengma013;
    @BindView(R.id.zhengma014)
    TextView zhengma014;
    @BindView(R.id.zhengma015)
    TextView zhengma015;
    @BindView(R.id.zhengma016)
    TextView zhengma016;
    @BindView(R.id.zhengma017)
    TextView zhengma017;
    @BindView(R.id.zhengma018)
    TextView zhengma018;
    @BindView(R.id.zhengma019)
    TextView zhengma019;
    @BindView(R.id.zhengma020)
    TextView zhengma020;
    @BindView(R.id.zhengma021)
    TextView zhengma021;
    @BindView(R.id.zhengma022)
    TextView zhengma022;
    @BindView(R.id.zhengma023)
    TextView zhengma023;
    @BindView(R.id.zhengma024)
    TextView zhengma024;
    @BindView(R.id.zhengma025)
    TextView zhengma025;
    @BindView(R.id.zhengma026)
    TextView zhengma026;
    @BindView(R.id.zhengma027)
    TextView zhengma027;
    @BindView(R.id.zhengma028)
    TextView zhengma028;
    @BindView(R.id.zhengma029)
    TextView zhengma029;
    @BindView(R.id.zhengma030)
    TextView zhengma030;
    @BindView(R.id.zhengma031)
    TextView zhengma031;
    @BindView(R.id.zhengma032)
    TextView zhengma032;
    @BindView(R.id.zhengma033)
    TextView zhengma033;
    @BindView(R.id.zhengma034)
    TextView zhengma034;
    @BindView(R.id.zhengma035)
    TextView zhengma035;
    @BindView(R.id.zhengma036)
    TextView zhengma036;
    @BindView(R.id.zhengma037)
    TextView zhengma037;
    @BindView(R.id.zhengma038)
    TextView zhengma038;
    @BindView(R.id.zhengma039)
    TextView zhengma039;
    @BindView(R.id.zhengma040)
    TextView zhengma040;
    @BindView(R.id.zhengma041)
    TextView zhengma041;
    @BindView(R.id.zhengma042)
    TextView zhengma042;
    @BindView(R.id.zhengma043)
    TextView zhengma043;
    @BindView(R.id.zhengma044)
    TextView zhengma044;
    @BindView(R.id.zhengma045)
    TextView zhengma045;
    @BindView(R.id.zhengma046)
    TextView zhengma046;
    @BindView(R.id.zhengma047)
    TextView zhengma047;
    @BindView(R.id.zhengma048)
    TextView zhengma048;
    @BindView(R.id.zhengma049)
    TextView zhengma049;
    @BindView(R.id.zhengma050)
    TextView zhengma050;
    @BindView(R.id.zhengma051)
    TextView zhengma051;
    @BindView(R.id.zhengma052)
    TextView zhengma052;
    @BindView(R.id.zhengma053)
    TextView zhengma053;
    @BindView(R.id.zhengma054)
    TextView zhengma054;
    @BindView(R.id.zhengma055)
    TextView zhengma055;
    @BindView(R.id.zhengma056)
    TextView zhengma056;
    @BindView(R.id.zhengma057)
    TextView zhengma057;
    @BindView(R.id.zhengma058)
    TextView zhengma058;
    @BindView(R.id.zhengma059)
    TextView zhengma059;
    @BindView(R.id.zhengma060)
    TextView zhengma060;
    @BindView(R.id.zhengma061)
    TextView zhengma061;
    @BindView(R.id.zhengma062)
    TextView zhengma062;
    @BindView(R.id.zhengma063)
    TextView zhengma063;
    @BindView(R.id.zhengma064)
    TextView zhengma064;
    @BindView(R.id.zhengma065)
    TextView zhengma065;
    @BindView(R.id.zhengma066)
    TextView zhengma066;
    @BindView(R.id.zhengma067)
    TextView zhengma067;
    @BindView(R.id.zhengma068)
    TextView zhengma068;
    @BindView(R.id.zhengma069)
    TextView zhengma069;
    @BindView(R.id.zhengma070)
    TextView zhengma070;
    @BindView(R.id.zhengma071)
    TextView zhengma071;
    @BindView(R.id.zhengma072)
    TextView zhengma072;
    @BindView(R.id.zhengma073)
    TextView zhengma073;
    @BindView(R.id.zhengma074)
    TextView zhengma074;
    @BindView(R.id.zhengma075)
    TextView zhengma075;
    @BindView(R.id.zhengma076)
    TextView zhengma076;
    @BindView(R.id.zhengma077)
    TextView zhengma077;
    @BindView(R.id.zhengma078)
    TextView zhengma078;
    @BindView(R.id.zhengma079)
    TextView zhengma079;
    @BindView(R.id.zhengma080)
    TextView zhengma080;
    @BindView(R.id.tetv0)
    TextView tetv0;
    @BindView(R.id.tetv1)
    TextView tetv1;
    @BindView(R.id.tetv2)
    TextView tetv2;
    @BindView(R.id.tetv3)
    TextView tetv3;
    @BindView(R.id.tetv4)
    TextView tetv4;
    @BindView(R.id.tetv5)
    TextView tetv5;
    @BindView(R.id.tetv6)
    TextView tetv6;
    @BindView(R.id.tetv7)
    TextView tetv7;
    @BindView(R.id.tetv8)
    TextView tetv8;
    @BindView(R.id.tetv9)
    TextView tetv9;
    @BindView(R.id.tetv10)
    TextView tetv10;
    @BindView(R.id.tetv11)
    TextView tetv11;
    @BindView(R.id.tetv12)
    TextView tetv12;
    @BindView(R.id.tetv13)
    TextView tetv13;
    @BindView(R.id.tetv14)
    TextView tetv14;
    @BindView(R.id.tetv15)
    TextView tetv15;
    @BindView(R.id.tetv16)
    TextView tetv16;
    @BindView(R.id.tetv17)
    TextView tetv17;
    @BindView(R.id.tetv18)
    TextView tetv18;
    @BindView(R.id.tetv19)
    TextView tetv19;
    @BindView(R.id.tetv20)
    TextView tetv20;
    @BindView(R.id.tetv21)
    TextView tetv21;
    @BindView(R.id.tetv22)
    TextView tetv22;
    @BindView(R.id.tetv23)
    TextView tetv23;
    @BindView(R.id.tetv24)
    TextView tetv24;
    @BindView(R.id.tetv25)
    TextView tetv25;
    @BindView(R.id.tetv26)
    TextView tetv26;
    @BindView(R.id.tetv27)
    TextView tetv27;
    private String gameid;//游戏id
    private String money;//金额
    private String dataid;//期数
    //    private String webvideo;//期数
    private TextView tvmoney;
    private AlertDialog dialog;
    private String betBean_title1[];
    private String betBean_text1[];
    private String betBean_odds1[];
    private String betBean_money1[];
    ArrayList<String> thecrownIndex = new ArrayList<>();//选中的集合
    ArrayList<Viewbean> linearLayoutsList = new ArrayList<>();//选中的线性布局
    private Adapter adapter;

    private String falg;//标记是不是正码，为了保留正码文字

    @Override
    protected void initDagger() {
        DaggerPCFragmentComponent.builder()
                .pCFragmentMdule(new PCFragmentMdule(this))
                .build().inject(this);
    }

    @Override
    protected void ChangeSkin() {

    }

    @Override
    protected int setContentView() {
        return R.layout.pcfragment;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        if (closeTimeTv.getText().toString().trim().equals("已封盘")) {
            fengpanlin.setVisibility(View.VISIBLE);
            xiazhubt.setEnabled(false);
            chongzhibt.setEnabled(false);
            touzhued.setEnabled(false);
        }
        final Drawable img = hunhebt.getResources().getDrawable(R.mipmap.whitedots);
// 调用setCompoundDrawables时，必须调用Drawable.setBounds()方法,否则图片不显示
        img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
        hunhebt.setCompoundDrawables(img, null, null, null);
        hunhebt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
        //输入框处理
//        getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);


        touzhued.setInputType(InputType.TYPE_NULL);
        keybord.init(touzhued, new KeyBoardWeight.Goback() {
            @Override
            public void goback() {
                keybord.setVisibility(View.GONE);
            }
        });
        touzhued.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                keybord.setVisibility(View.VISIBLE);
            }
        });
        touzhued.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                if (touzhued.getText().toString().matches("^0")) {//判断当前的输入第一个数是不是为0
                    touzhued.setText("");
                }
            }

            @Override
            public void afterTextChanged(Editable s) {
//                SYSOUtils.sOut_("wwwwwwwwwwwwwwwwwwwwww" + s);
            }
        });
        xiazhubt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                closeKeyBoard();
                String edmoney = touzhued.getText().toString().trim();
                if (TextUtils.isEmpty(edmoney)) {
                    Toast.makeText(getContext(), "请输入投注金额", Toast.LENGTH_SHORT).show();
                } else {

                    long Total_price = Long.parseLong(edmoney) * thecrownIndex.size();
                    String[] betBean_Play = new String[thecrownIndex.size()];
                    String[] betBean_odds = new String[thecrownIndex.size()];
                    String[] betBean_money = new String[thecrownIndex.size()];
                    String[] betBean_title = new String[thecrownIndex.size()];
                    String[] betBean_text = new String[thecrownIndex.size()];
                    if (thecrownIndex.size() != 0 && null != thecrownIndex) {
                        for (int i = 0; i < thecrownIndex.size(); i++) {
//                            SYSOUtils.sOut_("当前集合为" + linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))));
                            betBean_Play[i] = linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))).id;
                            betBean_money[i] = edmoney;
                            betBean_odds[i] = linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))).textViews.getText().toString();
                            betBean_title[i] = linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))).str;
                            if (null != linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))).textView) {

                                betBean_text[i] = linearLayoutsList.get(Integer.parseInt(thecrownIndex.get(i))).textView.getText().toString();
                            }


                        }
                        betBean_title1 = betBean_title;
                        betBean_text1 = betBean_text;
                        betBean_odds1 = betBean_odds;
                        betBean_money1 = betBean_money;
                    } else {
                        Toast.makeText(getContext(), "您还没有下注", Toast.LENGTH_SHORT).show();
                    }


                    try {
                        if (!TextUtils.isEmpty(gameid) && !TextUtils.isEmpty(dataid) && thecrownIndex.size() != 0 && Total_price != 0) {

                            final JSONObject result = new JSONObject();
                            result.put("gameId", gameid);
                            result.put("turnNum", dataid);
                            result.put("totalNums", thecrownIndex.size() + "");
                            result.put("totalMoney", Total_price + "");
                            for (int i = 0; i < betBean_Play.length; i++) {
                                result.put("betBean_playId[" + i + "]", betBean_Play[i]);
                                result.put("betBean_odds[" + i + "]", betBean_odds[i]);
                                result.put("betBean_money[" + i + "]", betBean_money[i]);
                            }
                            SYSOUtils.sOut_("数据" + result);
//                            SYSOUtils.sOut_("游戏id" + gameid + "期数" + dataid + "总株数" + thecrownIndex.size() + "下注总金额" + Total_price);
//                            SYSOUtils.sOut_("每一注id" + betBean_Play[0] + "每一住赔率" + betBean_odds[0] + "没注金额" + betBean_money[0]);
//                            SYSOUtils.sOut_("最终json1" + result.toString());

                            AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
                            View view = View.inflate(getContext(), R.layout.gamepop_layout, null);
                            RecyclerView game_pop_list = (RecyclerView) view.findViewById(R.id.game_pop_list);
                            TextView game_pop_canclbt = (TextView) view.findViewById(R.id.game_pop_canclbt);
                            TextView game_pop_yesbt = (TextView) view.findViewById(R.id.game_pop_yesbt);
                            game_pop_list.setLayoutManager(new LinearLayoutManager(getContext()));
                            //创建适配器
                            adapter = new Adapter();
                            game_pop_list.setAdapter(adapter);
                            builder.setView(view);
                            dialog = builder.create();
                            dialog.setCancelable(true);//点击外边缘隐藏
                            dialog.show();
                            game_pop_canclbt.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    dialog.dismiss();
                                }
                            });
                            game_pop_yesbt.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                                    dialog.dismiss();
                                    mPresenter.Betbet(result.toString(), Info.user.token);
                                }
                            });

                        } else {
                            Toast.makeText(getContext(), "请选择正确投注内容", Toast.LENGTH_SHORT).show();
                        }
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }

            }
        });
        //获取游戏id
        final FragmentActivity activity = getActivity();
        if (activity != null) {
            final GameDetailActivityFinal gameDetailsActivity = (GameDetailActivityFinal) activity;
            gameid = gameDetailsActivity.gameid;
            money = gameDetailsActivity.money;
            tvmoney = gameDetailsActivity.moneyTv;
//            webvideo = gameDetailsActivity.webvideo;
        }

        if (gameid != null) {
//头部
            mPresenter.getgamesdetail(gameid);
            switch (Integer.parseInt(gameid)) {
                case 66:
                    //pc蛋蛋
                    putongtv.setVisibility(View.VISIBLE);
                    pcdandanIv.setVisibility(View.VISIBLE);
                    leftbtlin.setVisibility(View.VISIBLE);
                    hunheLin.setVisibility(View.VISIBLE);
                    mPresenter.getpcdandanoddes(gameid, Info.user.token);
                    break;
                case 65:
                    //快乐北京8
                    kuai8IvLin.setVisibility(View.VISIBLE);
                    kuai8tv.setVisibility(View.VISIBLE);
                    includeBeijingkuaileitem.setVisibility(View.VISIBLE);
                    leftbtlin.setVisibility(View.GONE);
                    putongtv.setVisibility(View.GONE);
                    pcdandanIv.setVisibility(View.GONE);
                    includGuanyaheItem.setVisibility(View.GONE);
                    mPresenter.getkuailebeijing8oddes(gameid, Info.user.token);
                    break;
            }
        }

        hunhebt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                falg = "";
                btsetcolor();
                chongzhi();
                hunhebt.setCompoundDrawables(img, null, null, null);
                hunhebt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                hunhebt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
                includGuanyaheItem.setVisibility(View.VISIBLE);
                temaItem.setVisibility(View.GONE);

            }
        });
        temabt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                falg = "11";
                btsetcolor();
                chongzhi();
                temabt.setCompoundDrawables(img, null, null, null);
                temabt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                temabt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
                temaItem.setVisibility(View.VISIBLE);
                includGuanyaheItem.setVisibility(View.GONE);
            }
        });
        chongzhibt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                for (Viewbean q : linearLayoutsList) {
                    q.linearLayout.setBackgroundResource(R.drawable.betting_backgroud);
                    if (null != q.textView) {
                        q.textView.setTextColor(getContext().getResources().getColor(R.color.blank));
                    }
                    q.textViews.setTextColor(getContext().getResources().getColor(R.color.text_color));
                    thecrownIndex.remove(q + "");
                }
                thecrownIndex.clear();
                yixuanzhong.setText(thecrownIndex.size() + "");
            }
        });

        kuai8Liangmianbt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btsetcolor();
                chongzhi();
                kuai8Liangmianbt.setCompoundDrawables(img, null, null, null);
                kuai8Liangmianbt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                kuai8Liangmianbt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
                kuai8Liangmianlin.setVisibility(View.VISIBLE);
                wuhangItem.setVisibility(View.GONE);
                zhengmaitem.setVisibility(View.GONE);
            }
        });
        wuhangbt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                chongzhi();
                btsetcolor();
                wuhangbt.setCompoundDrawables(img, null, null, null);
                wuhangbt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                wuhangbt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
                kuai8Liangmianlin.setVisibility(View.GONE);
                wuhangItem.setVisibility(View.VISIBLE);
                zhengmaitem.setVisibility(View.GONE);
            }
        });
        zhengma.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                chongzhi();
                btsetcolor();
                falg = "11";
                zhengma.setCompoundDrawables(img, null, null, null);
                zhengma.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                kuai8Liangmianlin.setVisibility(View.GONE);
                zhengma.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
                wuhangItem.setVisibility(View.GONE);
                zhengmaitem.setVisibility(View.VISIBLE);
            }
        });


    }

    private void btsetcolor() {
        hunhebt.setTextColor(getContext().getResources().getColor(R.color.blank));
        temabt.setTextColor(getContext().getResources().getColor(R.color.blank));
        kuai8Liangmianbt.setTextColor(getContext().getResources().getColor(R.color.blank));
        wuhangbt.setTextColor(getContext().getResources().getColor(R.color.blank));
        zhengma.setTextColor(getContext().getResources().getColor(R.color.blank));

        hunhebt.setBackgroundColor(getResources().getColor(R.color.gamebackground));
        temabt.setBackgroundColor(getResources().getColor(R.color.gamebackground));
        kuai8Liangmianbt.setBackgroundColor(getResources().getColor(R.color.gamebackground));
        wuhangbt.setBackgroundColor(getResources().getColor(R.color.gamebackground));
        zhengma.setBackgroundColor(getResources().getColor(R.color.gamebackground));

        Drawable img = hunhebt.getResources().getDrawable(R.mipmap.graydots);
// 调用setCompoundDrawables时，必须调用Drawable.setBounds()方法,否则图片不显示
        img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
        hunhebt.setCompoundDrawables(img, null, null, null);
        temabt.setCompoundDrawables(img, null, null, null);
        kuai8Liangmianbt.setCompoundDrawables(img, null, null, null);
        wuhangbt.setCompoundDrawables(img, null, null, null);
        zhengma.setCompoundDrawables(img, null, null, null);
    }

    //每选择一个选项清空一次
    public void chongzhi() {
        falg = null;
        for (Viewbean q : linearLayoutsList) {
            q.linearLayout.setBackgroundResource(R.drawable.betting_backgroud);
            if (null != q.textView) {
                q.textView.setTextColor(getContext().getResources().getColor(R.color.blank));
            }
            if (null != q.textViews) {
                q.textViews.setTextColor(getContext().getResources().getColor(R.color.text_color));
            }
            thecrownIndex.remove(q + "");
        }
        thecrownIndex.clear();
        yixuanzhong.setText(thecrownIndex.size() + "");
    }


    /**
     * 快乐北京8
     */
    public void setkuaile8(Reskuaile8.DataBean listdata) {
        final Drawable img = hunhebt.getResources().getDrawable(R.mipmap.whitedots);
// 调用setCompoundDrawables时，必须调用Drawable.setBounds()方法,否则图片不显示
        img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
        btsetcolor();
        chongzhi();
        kuai8Liangmianbt.setCompoundDrawables(img, null, null, null);
        kuai8Liangmianbt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
        kuai8Liangmianbt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
        zonghedas.setText(listdata._$65211259);
        zonghexiaos.setText(listdata._$65211260);
        zonghedans.setText(listdata._$65211261);
        zongheshuangs.setText(listdata._$65211262);
        linearLayoutsList.add(new Viewbean(zonghedalin, zongheda, zonghedas, "总和", "65211259"));
        linearLayoutsList.add(new Viewbean(zonghexiaolin, zonghexiao, zonghexiaos, "总和", "65211260"));
        linearLayoutsList.add(new Viewbean(zonghedanlin, zonghedan, zonghedans, "总和", "65211261"));
        linearLayoutsList.add(new Viewbean(zongheshuanglin, zongheshuang, zongheshuangs, "总和", "65211262"));

        zongdadans.setText(listdata._$65211264);
        zongdashuangs.setText(listdata._$65211265);
        zongxiaodans.setText(listdata._$65211266);
        zongxiaoshuangs.setText(listdata._$65211267);
        linearLayoutsList.add(new Viewbean(zongdadanlin, zongdadan, zongdadans, "总和", "65211264"));
        linearLayoutsList.add(new Viewbean(zongdashuanglin, zongdashuang, zongdashuangs, "总和", "65211265"));
        linearLayoutsList.add(new Viewbean(zongxiaodanlin, zongxiaodan, zongxiaodans, "总和", "65211266"));
        linearLayoutsList.add(new Viewbean(zongxiaoshuanglin, zongxiaoshuang, zongxiaoshuangs, "总和", "65211267"));
        qianduos.setText(listdata._$65221268);
        houduos.setText(listdata._$65221269);
        qianhouhes.setText(listdata._$65221270);
        danduos.setText(listdata._$65231271);
        shuangduos.setText(listdata._$65231272);
        danshuanghes.setText(listdata._$65231273);
        linearLayoutsList.add(new Viewbean(qianduolin, qianduo, qianduos, "前后和", "65221268"));
        linearLayoutsList.add(new Viewbean(houduolin, houduo, houduos, "前后和", "65221269"));
        linearLayoutsList.add(new Viewbean(qianhouhelin, qianhouhe, qianhouhes, "前后和", "65221270"));
        linearLayoutsList.add(new Viewbean(danduolin, danduo, danduos, "单双和", "65231271"));
        linearLayoutsList.add(new Viewbean(zshuangduolin, shuangduo, shuangduos, "单双和", "65231272"));
        linearLayoutsList.add(new Viewbean(danshaunghelin, danshuanghe, danshuanghes, "单双和", "65231273"));
        jintvs.setText(listdata._$65241274);
        mutvs.setText(listdata._$65241275);
        shuitvs.setText(listdata._$65241276);
        huotvs.setText(listdata._$65241277);
        tutvs.setText(listdata._$65241278);
        linearLayoutsList.add(new Viewbean(jintvlin, jintv, jintvs, "五行", "65241274"));
        linearLayoutsList.add(new Viewbean(mutvlin, mutv, mutvs, "五行", "65241275"));
        linearLayoutsList.add(new Viewbean(shuitvlin, shuitv, shuitvs, "五行", "65241276"));
        linearLayoutsList.add(new Viewbean(huotvlin, huotv, huotvs, "五行", "65241277"));
        linearLayoutsList.add(new Viewbean(tutvlin, tutv, tutvs, "五行", "65241278"));

        zhengma1.setText(listdata._$65251279);
        zhengma2.setText(listdata._$65251280);
        zhengma3.setText(listdata._$65251281);
        zhengma4.setText(listdata._$65251282);
        zhengma5.setText(listdata._$65251283);
        zhengma6.setText(listdata._$65251284);
        zhengma7.setText(listdata._$65251285);
        zhengma8.setText(listdata._$65251286);
        zhengma9.setText(listdata._$65251287);
        zhengma10.setText(listdata._$65251288);
        zhengma11.setText(listdata._$65251289);
        zhengma12.setText(listdata._$65251290);
        zhengma13.setText(listdata._$65251291);
        zhengma14.setText(listdata._$65251292);
        zhengma15.setText(listdata._$65251293);
        zhengma16.setText(listdata._$65251294);
        zhengma17.setText(listdata._$65251295);
        zhengma18.setText(listdata._$65251296);
        zhengma19.setText(listdata._$65251297);
        zhengma20.setText(listdata._$65251298);
        zhengma21.setText(listdata._$65251299);
        zhengma22.setText(listdata._$65251300);
        zhengma23.setText(listdata._$65251301);
        zhengma24.setText(listdata._$65251302);
        zhengma25.setText(listdata._$65251303);
        zhengma26.setText(listdata._$65251304);
        zhengma27.setText(listdata._$65251305);
        zhengma28.setText(listdata._$65251306);
        zhengma29.setText(listdata._$65251307);
        zhengma30.setText(listdata._$65251308);
        zhengma31.setText(listdata._$65251309);
        zhengma32.setText(listdata._$65251310);
        zhengma33.setText(listdata._$65251311);
        zhengma34.setText(listdata._$65251312);
        zhengma35.setText(listdata._$65251313);
        zhengma36.setText(listdata._$65251314);
        zhengma37.setText(listdata._$65251315);
        zhengma38.setText(listdata._$65251316);
        zhengma39.setText(listdata._$65251317);
        zhengma40.setText(listdata._$65251318);
        zhengma41.setText(listdata._$65251319);
        zhengma42.setText(listdata._$65251320);
        zhengma43.setText(listdata._$65251321);
        zhengma44.setText(listdata._$65251322);
        zhengma45.setText(listdata._$65251323);
        zhengma46.setText(listdata._$65251324);
        zhengma47.setText(listdata._$65251325);
        zhengma48.setText(listdata._$65251326);
        zhengma49.setText(listdata._$65251327);
        zhengma50.setText(listdata._$65251328);
        zhengma51.setText(listdata._$65251329);
        zhengma52.setText(listdata._$65251330);
        zhengma53.setText(listdata._$65251331);
        zhengma54.setText(listdata._$65251332);
        zhengma55.setText(listdata._$65251333);
        zhengma56.setText(listdata._$65251334);
        zhengma57.setText(listdata._$65251335);
        zhengma58.setText(listdata._$65251336);
        zhengma59.setText(listdata._$65251337);
        zhengma60.setText(listdata._$65251338);
        zhengma61.setText(listdata._$65251339);
        zhengma62.setText(listdata._$65251340);
        zhengma63.setText(listdata._$65251341);
        zhengma64.setText(listdata._$65251342);
        zhengma65.setText(listdata._$65251343);
        zhengma66.setText(listdata._$65251344);
        zhengma67.setText(listdata._$65251345);
        zhengma68.setText(listdata._$65251346);
        zhengma69.setText(listdata._$65251347);
        zhengma70.setText(listdata._$65251348);
        zhengma71.setText(listdata._$65251349);
        zhengma72.setText(listdata._$65251350);
        zhengma73.setText(listdata._$65251351);
        zhengma74.setText(listdata._$65251352);
        zhengma75.setText(listdata._$65251353);
        zhengma76.setText(listdata._$65251354);
        zhengma77.setText(listdata._$65251355);
        zhengma78.setText(listdata._$65251356);
        zhengma79.setText(listdata._$65251357);
        zhengma80.setText(listdata._$65251358);
        linearLayoutsList.add(new Viewbean(zhengmalin1, zhengma01, zhengma1, "正码", "65251279"));
        linearLayoutsList.add(new Viewbean(zhengmalin2, zhengma02, zhengma2, "正码", "65251280"));
        linearLayoutsList.add(new Viewbean(zhengmalin3, zhengma03, zhengma3, "正码", "65251281"));
        linearLayoutsList.add(new Viewbean(zhengmalin4, zhengma04, zhengma4, "正码", "65251282"));
        linearLayoutsList.add(new Viewbean(zhengmalin5, zhengma05, zhengma5, "正码", "65251283"));
        linearLayoutsList.add(new Viewbean(zhengmalin6, zhengma06, zhengma6, "正码", "65251284"));
        linearLayoutsList.add(new Viewbean(zhengmalin7, zhengma07, zhengma7, "正码", "65251285"));
        linearLayoutsList.add(new Viewbean(zhengmalin8, zhengma08, zhengma8, "正码", "65251286"));
        linearLayoutsList.add(new Viewbean(zhengmalin9, zhengma09, zhengma9, "正码", "65251287"));
        linearLayoutsList.add(new Viewbean(zhengmalin10, zhengma010, zhengma10, "正码", "65251288"));
        linearLayoutsList.add(new Viewbean(zhengmalin11, zhengma011, zhengma11, "正码", "65251289"));
        linearLayoutsList.add(new Viewbean(zhengmalin12, zhengma012, zhengma12, "正码", "65251290"));
        linearLayoutsList.add(new Viewbean(zhengmalin13, zhengma013, zhengma13, "正码", "65251291"));
        linearLayoutsList.add(new Viewbean(zhengmalin14, zhengma014, zhengma14, "正码", "65251292"));
        linearLayoutsList.add(new Viewbean(zhengmalin15, zhengma015, zhengma15, "正码", "65251293"));
        linearLayoutsList.add(new Viewbean(zhengmalin16, zhengma016, zhengma16, "正码", "65251294"));
        linearLayoutsList.add(new Viewbean(zhengmalin17, zhengma017, zhengma17, "正码", "65251295"));
        linearLayoutsList.add(new Viewbean(zhengmalin18, zhengma018, zhengma18, "正码", "65251296"));
        linearLayoutsList.add(new Viewbean(zhengmalin19, zhengma019, zhengma19, "正码", "65251297"));
        linearLayoutsList.add(new Viewbean(zhengmalin20, zhengma020, zhengma20, "正码", "65251298"));
        linearLayoutsList.add(new Viewbean(zhengmalin21, zhengma021, zhengma21, "正码", "65251299"));
        linearLayoutsList.add(new Viewbean(zhengmalin22, zhengma022, zhengma22, "正码", "65251300"));
        linearLayoutsList.add(new Viewbean(zhengmalin23, zhengma023, zhengma23, "正码", "65251301"));
        linearLayoutsList.add(new Viewbean(zhengmalin24, zhengma024, zhengma24, "正码", "65251302"));
        linearLayoutsList.add(new Viewbean(zhengmalin25, zhengma025, zhengma25, "正码", "65251303"));
        linearLayoutsList.add(new Viewbean(zhengmalin26, zhengma026, zhengma26, "正码", "65251304"));
        linearLayoutsList.add(new Viewbean(zhengmalin27, zhengma027, zhengma27, "正码", "65251305"));
        linearLayoutsList.add(new Viewbean(zhengmalin28, zhengma028, zhengma28, "正码", "65251306"));
        linearLayoutsList.add(new Viewbean(zhengmalin29, zhengma029, zhengma29, "正码", "65251307"));
        linearLayoutsList.add(new Viewbean(zhengmalin30, zhengma030, zhengma30, "正码", "65251308"));
        linearLayoutsList.add(new Viewbean(zhengmalin31, zhengma031, zhengma31, "正码", "65251309"));
        linearLayoutsList.add(new Viewbean(zhengmalin32, zhengma032, zhengma32, "正码", "65251310"));
        linearLayoutsList.add(new Viewbean(zhengmalin33, zhengma033, zhengma33, "正码", "65251311"));
        linearLayoutsList.add(new Viewbean(zhengmalin34, zhengma034, zhengma34, "正码", "65251312"));
        linearLayoutsList.add(new Viewbean(zhengmalin35, zhengma035, zhengma35, "正码", "65251313"));
        linearLayoutsList.add(new Viewbean(zhengmalin36, zhengma036, zhengma36, "正码", "65251314"));
        linearLayoutsList.add(new Viewbean(zhengmalin37, zhengma037, zhengma37, "正码", "65251315"));
        linearLayoutsList.add(new Viewbean(zhengmalin38, zhengma038, zhengma38, "正码", "65251316"));
        linearLayoutsList.add(new Viewbean(zhengmalin39, zhengma039, zhengma39, "正码", "65251317"));
        linearLayoutsList.add(new Viewbean(zhengmalin40, zhengma040, zhengma40, "正码", "65251318"));
        linearLayoutsList.add(new Viewbean(zhengmalin41, zhengma041, zhengma41, "正码", "65251319"));
        linearLayoutsList.add(new Viewbean(zhengmalin42, zhengma042, zhengma42, "正码", "65251320"));
        linearLayoutsList.add(new Viewbean(zhengmalin43, zhengma043, zhengma43, "正码", "65251321"));
        linearLayoutsList.add(new Viewbean(zhengmalin44, zhengma044, zhengma44, "正码", "65251322"));
        linearLayoutsList.add(new Viewbean(zhengmalin45, zhengma045, zhengma45, "正码", "65251323"));
        linearLayoutsList.add(new Viewbean(zhengmalin46, zhengma046, zhengma46, "正码", "65251324"));
        linearLayoutsList.add(new Viewbean(zhengmalin47, zhengma047, zhengma47, "正码", "65251325"));
        linearLayoutsList.add(new Viewbean(zhengmalin48, zhengma048, zhengma48, "正码", "65251326"));
        linearLayoutsList.add(new Viewbean(zhengmalin49, zhengma049, zhengma49, "正码", "65251327"));
        linearLayoutsList.add(new Viewbean(zhengmalin50, zhengma050, zhengma50, "正码", "65251328"));
        linearLayoutsList.add(new Viewbean(zhengmalin51, zhengma051, zhengma51, "正码", "65251329"));
        linearLayoutsList.add(new Viewbean(zhengmalin52, zhengma052, zhengma52, "正码", "65251330"));
        linearLayoutsList.add(new Viewbean(zhengmalin53, zhengma053, zhengma53, "正码", "65251331"));
        linearLayoutsList.add(new Viewbean(zhengmalin54, zhengma054, zhengma54, "正码", "65251332"));
        linearLayoutsList.add(new Viewbean(zhengmalin55, zhengma055, zhengma55, "正码", "65251333"));
        linearLayoutsList.add(new Viewbean(zhengmalin56, zhengma056, zhengma56, "正码", "65251334"));
        linearLayoutsList.add(new Viewbean(zhengmalin57, zhengma057, zhengma57, "正码", "65251335"));
        linearLayoutsList.add(new Viewbean(zhengmalin58, zhengma058, zhengma58, "正码", "65251336"));
        linearLayoutsList.add(new Viewbean(zhengmalin59, zhengma059, zhengma59, "正码", "65251337"));
        linearLayoutsList.add(new Viewbean(zhengmalin60, zhengma060, zhengma60, "正码", "65251338"));
        linearLayoutsList.add(new Viewbean(zhengmalin61, zhengma061, zhengma61, "正码", "65251339"));
        linearLayoutsList.add(new Viewbean(zhengmalin62, zhengma062, zhengma62, "正码", "65251340"));
        linearLayoutsList.add(new Viewbean(zhengmalin63, zhengma063, zhengma63, "正码", "65251341"));
        linearLayoutsList.add(new Viewbean(zhengmalin64, zhengma064, zhengma64, "正码", "65251342"));
        linearLayoutsList.add(new Viewbean(zhengmalin65, zhengma065, zhengma65, "正码", "65251343"));
        linearLayoutsList.add(new Viewbean(zhengmalin66, zhengma066, zhengma66, "正码", "65251344"));
        linearLayoutsList.add(new Viewbean(zhengmalin67, zhengma067, zhengma67, "正码", "65251345"));
        linearLayoutsList.add(new Viewbean(zhengmalin68, zhengma068, zhengma68, "正码", "65251346"));
        linearLayoutsList.add(new Viewbean(zhengmalin69, zhengma069, zhengma69, "正码", "65251347"));
        linearLayoutsList.add(new Viewbean(zhengmalin70, zhengma070, zhengma70, "正码", "65251348"));
        linearLayoutsList.add(new Viewbean(zhengmalin71, zhengma071, zhengma71, "正码", "65251349"));
        linearLayoutsList.add(new Viewbean(zhengmalin72, zhengma072, zhengma72, "正码", "65251350"));
        linearLayoutsList.add(new Viewbean(zhengmalin73, zhengma073, zhengma73, "正码", "65251351"));
        linearLayoutsList.add(new Viewbean(zhengmalin74, zhengma074, zhengma74, "正码", "65251352"));
        linearLayoutsList.add(new Viewbean(zhengmalin75, zhengma075, zhengma75, "正码", "65251353"));
        linearLayoutsList.add(new Viewbean(zhengmalin76, zhengma076, zhengma76, "正码", "65251354"));
        linearLayoutsList.add(new Viewbean(zhengmalin77, zhengma077, zhengma77, "正码", "65251355"));
        linearLayoutsList.add(new Viewbean(zhengmalin78, zhengma078, zhengma78, "正码", "65251356"));
        linearLayoutsList.add(new Viewbean(zhengmalin79, zhengma079, zhengma79, "正码", "65251357"));
        linearLayoutsList.add(new Viewbean(zhengmalin80, zhengma080, zhengma80, "正码", "65251358"));
        textcolorlist();
    }

    //快乐8
    public void beijingkuaile(ResGameDetails resGameDetails) {
        GameDetailActivityFinal.webvideo = resGameDetails.data.videoUrl;
//        webvideo = resGameDetails.data.videoUrl;
        dataid = String.valueOf(resGameDetails.data.issue);
        startleftTime(resGameDetails.data.endTime, resGameDetails.data.serverTime);
        startrightTime(resGameDetails.data.lotteryTime, resGameDetails.data.serverTime, 1);

        kuai8UpTv.setText(resGameDetails.data.preIssue + "期");
        periodDownTv.setText(resGameDetails.data.issue + "期");
        SYSOUtils.sOut_(resGameDetails.data.preNum);
        String[] strarray = resGameDetails.data.preNum.split(",");
        kuai8One.setText(strarray[0]);
        kuai8Two.setText(strarray[1]);
        kuai8Three.setText(strarray[2]);
        kuai8Four.setText(strarray[3]);
        kuai8Fiv.setText(strarray[4]);
        kuai8Six.setText(strarray[5]);
        kuai8Seven.setText(strarray[6]);
        kuai8Eight.setText(strarray[7]);
        kuai8Noon.setText(strarray[8]);
        kuai8Ten.setText(strarray[9]);
        kuai8Onet.setText(strarray[10]);
        kuai8Twot.setText(strarray[11]);
        kuai8Threet.setText(strarray[12]);
        kuai8Fourt.setText(strarray[13]);
        kuai8Fivt.setText(strarray[14]);
        kuai8Sixt.setText(strarray[15]);
        kuai8Sevent.setText(strarray[16]);
        kuai8Eightt.setText(strarray[17]);
        kuai8Noont.setText(strarray[18]);
        kuai8Tent.setText(strarray[19]);
        if (!TextUtils.isEmpty(resGameDetails.data.issue.toString()) && !TextUtils.isEmpty(resGameDetails.data.preIssue.toString())) {
            long b = Long.parseLong(resGameDetails.data.issue.toString()) - Long.parseLong(resGameDetails.data.preIssue.toString());
            if (b != 1 && b < 3) {
                mPresenter.getgamesdetail1(gameid);
                return;
            }
        }
        //请求余额刷新
        if (null != Info.user) {
            mPresenter.getmoney(Info.user.token);
        }
    }

    public void beijingkuaile1(ResGameDetails resGameDetails) {
        GameDetailActivityFinal.webvideo = resGameDetails.data.videoUrl;
        dataid = String.valueOf(resGameDetails.data.issue);
        kuai8UpTv.setText(resGameDetails.data.preIssue + "期");
        periodDownTv.setText(resGameDetails.data.issue + "期");
        if (!TextUtils.isEmpty(resGameDetails.data.issue.toString()) && !TextUtils.isEmpty(resGameDetails.data.preIssue.toString())) {
            long b = Long.parseLong(resGameDetails.data.issue.toString()) - Long.parseLong(resGameDetails.data.preIssue.toString());
            if (b != 1 && b < 3) {
                if (timer1 != null) {
                    timer1.cancel();
                    timer1 = null;
                }
                if (timer2 != null) {
                    timer2.cancel();
                    timer2 = null;
                }
                mPresenter.getgamesdetail(gameid);
                return;
            }
        }
        SYSOUtils.sOut_(resGameDetails.data.preNum);
        String[] strarray = resGameDetails.data.preNum.split(",");
        kuai8One.setText(strarray[0]);
        kuai8Two.setText(strarray[1]);
        kuai8Three.setText(strarray[2]);
        kuai8Four.setText(strarray[3]);
        kuai8Fiv.setText(strarray[4]);
        kuai8Six.setText(strarray[5]);
        kuai8Seven.setText(strarray[6]);
        kuai8Eight.setText(strarray[7]);
        kuai8Noon.setText(strarray[8]);
        kuai8Ten.setText(strarray[9]);
        kuai8Onet.setText(strarray[10]);
        kuai8Twot.setText(strarray[11]);
        kuai8Threet.setText(strarray[12]);
        kuai8Fourt.setText(strarray[13]);
        kuai8Fivt.setText(strarray[14]);
        kuai8Sixt.setText(strarray[15]);
        kuai8Sevent.setText(strarray[16]);
        kuai8Eightt.setText(strarray[17]);
        kuai8Noont.setText(strarray[18]);
        kuai8Tent.setText(strarray[19]);
    }

    /**
     * pc蛋蛋
     */
    public void setpcdandan(Respcdandan.DataBean listdata) {
//        two.setText("混合");
        btsetcolor();
        chongzhi();
        Drawable img = hunhebt.getResources().getDrawable(R.mipmap.whitedots);
// 调用setCompoundDrawables时，必须调用Drawable.setBounds()方法,否则图片不显示
        img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
        hunhebt.setCompoundDrawables(img, null, null, null);
        hunhebt.setTextColor(getContext().getResources().getColor(R.color.settingbg));
        hunhebt.setBackgroundColor(getContext().getResources().getColor(R.color.text_color2));
        guanyahetitle.setText("混合");
        guanyalong.setText("极大");
        guanyahu.setText("极小");
        guanyahe.setText("豹子");
        guanyada.setText("大");
        guanyadas.setText(listdata._$66911741);
        guanyaxiao.setText("小");
        guanyaxiaos.setText(listdata._$66911742);
        guanyadan.setText("单");
        guanyadans.setText(listdata._$66911743);
        guanyashuang.setText("双");
        guanyashuangs.setText(listdata._$66911744);
        linearLayoutsList.add(new Viewbean(guanyadalin, guanyada, guanyadas, "冠亚和", "66911741"));
        linearLayoutsList.add(new Viewbean(guanyaxiaolin, guanyaxiao, guanyaxiaos, "冠亚和", "66911742"));
        linearLayoutsList.add(new Viewbean(guanyadanlin, guanyadan, guanyadans, "冠亚和", "66911743"));
        linearLayoutsList.add(new Viewbean(guanyashuanglin, guanyashuang, guanyashuangs, "冠亚和", "66911744"));

        guanyalongs.setText(listdata._$66911749);
        guanyahus.setText(listdata._$66911750);
        guanyahes.setText(listdata._$66911751);
        linearLayoutsList.add(new Viewbean(guanyalonglin, guanyalong, guanyalongs, "总和、龙虎", "66911749"));
        linearLayoutsList.add(new Viewbean(guanyahulin, guanyahu, guanyahus, "总和、龙虎", "66911750"));
        linearLayoutsList.add(new Viewbean(guanyahelin, guanyahe, guanyahes, "总和、龙虎", "66911751"));

        hongbos.setText(listdata._$66921752);
        lvbos.setText(listdata._$66921753);
        lanbos.setText(listdata._$66921754);
        linearLayoutsList.add(new Viewbean(hongbolin, hongbo, hongbos, "总和、龙虎", "66921752"));
        linearLayoutsList.add(new Viewbean(lvbolin, lvbo, lvbos, "总和、龙虎", "66921753"));
        linearLayoutsList.add(new Viewbean(lanbolin, lanbo, lanbos, "总和、龙虎", "66921754"));

        tetvs0.setText(listdata._$66931755);
        tetvs1.setText(listdata._$66931756);
        tetvs2.setText(listdata._$66931757);
        tetvs3.setText(listdata._$66931758);
        tetvs4.setText(listdata._$66931759);
        tetvs5.setText(listdata._$66931760);
        tetvs6.setText(listdata._$66931761);
        tetvs7.setText(listdata._$66931762);
        tetvs8.setText(listdata._$66931763);
        tetvs9.setText(listdata._$66931764);
        tetvs10.setText(listdata._$66931765);
        tetvs11.setText(listdata._$66931766);
        tetvs12.setText(listdata._$66931767);
        tetvs13.setText(listdata._$66931768);
        tetvs14.setText(listdata._$66931769);
        tetvs15.setText(listdata._$66931770);
        tetvs16.setText(listdata._$66931771);
        tetvs17.setText(listdata._$66931772);
        tetvs18.setText(listdata._$66931773);
        tetvs19.setText(listdata._$66931774);
        tetvs20.setText(listdata._$66931775);
        tetvs21.setText(listdata._$66931776);
        tetvs22.setText(listdata._$66931777);
        tetvs23.setText(listdata._$66931778);
        tetvs24.setText(listdata._$66931779);
        tetvs25.setText(listdata._$66931780);
        tetvs26.setText(listdata._$66931781);
        tetvs27.setText(listdata._$66931782);
        linearLayoutsList.add(new Viewbean(temalin0, tetv0, tetvs0, "特码", "66931755"));
        linearLayoutsList.add(new Viewbean(temalin1, tetv1, tetvs1, "特码", "66931756"));
        linearLayoutsList.add(new Viewbean(temalin2, tetv2, tetvs2, "特码", "66931757"));
        linearLayoutsList.add(new Viewbean(temalin3, tetv3, tetvs3, "特码", "66931758"));
        linearLayoutsList.add(new Viewbean(temalin4, tetv4, tetvs4, "特码", "66931759"));
        linearLayoutsList.add(new Viewbean(temalin5, tetv5, tetvs5, "特码", "66931760"));
        linearLayoutsList.add(new Viewbean(temalin6, tetv6, tetvs6, "特码", "66931761"));
        linearLayoutsList.add(new Viewbean(temalin7, tetv7, tetvs7, "特码", "66931762"));
        linearLayoutsList.add(new Viewbean(temalin8, tetv8, tetvs8, "特码", "66931763"));
        linearLayoutsList.add(new Viewbean(temalin9, tetv9, tetvs9, "特码", "66931764"));
        linearLayoutsList.add(new Viewbean(temalin10, tetv10, tetvs10, "特码", "66931765"));
        linearLayoutsList.add(new Viewbean(temalin11, tetv11, tetvs11, "特码", "66931766"));
        linearLayoutsList.add(new Viewbean(temalin12, tetv12, tetvs12, "特码", "66931767"));
        linearLayoutsList.add(new Viewbean(temalin13, tetv13, tetvs13, "特码", "66931768"));
        linearLayoutsList.add(new Viewbean(temalin14, tetv14, tetvs14, "特码", "66931769"));
        linearLayoutsList.add(new Viewbean(temalin15, tetv15, tetvs15, "特码", "66931770"));
        linearLayoutsList.add(new Viewbean(temalin16, tetv16, tetvs16, "特码", "66931771"));
        linearLayoutsList.add(new Viewbean(temalin17, tetv17, tetvs17, "特码", "66931772"));
        linearLayoutsList.add(new Viewbean(temalin18, tetv18, tetvs18, "特码", "66931773"));
        linearLayoutsList.add(new Viewbean(temalin19, tetv19, tetvs19, "特码", "66931774"));
        linearLayoutsList.add(new Viewbean(temalin20, tetv20, tetvs20, "特码", "66931775"));
        linearLayoutsList.add(new Viewbean(temalin21, tetv21, tetvs21, "特码", "66931776"));
        linearLayoutsList.add(new Viewbean(temalin22, tetv22, tetvs22, "特码", "66931777"));
        linearLayoutsList.add(new Viewbean(temalin23, tetv23, tetvs23, "特码", "66931778"));
        linearLayoutsList.add(new Viewbean(temalin24, tetv24, tetvs24, "特码", "66931779"));
        linearLayoutsList.add(new Viewbean(temalin25, tetv25, tetvs25, "特码", "66931780"));
        linearLayoutsList.add(new Viewbean(temalin26, tetv26, tetvs26, "特码", "66931781"));
        linearLayoutsList.add(new Viewbean(temalin27, tetv27, tetvs27, "特码", "66931782"));
        textcolorlist();
    }

    //设置字体颜色和背景色
    private void textcolorlist() {
        for (int i = 0; i < linearLayoutsList.size(); i++) {
            final int q = i;

            linearLayoutsList.get(i).linearLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if (thecrownIndex.contains(q + "")) {
                        thecrownIndex.remove(q + "");
                        linearLayoutsList.get(q).linearLayout.setBackgroundResource(R.drawable.betting_backgroud);
                        if (null != linearLayoutsList.get(q).textView) {
                            linearLayoutsList.get(q).textView.setTextColor(getContext().getResources().getColor(R.color.blank));
                        }
                        linearLayoutsList.get(q).textViews.setTextColor(getContext().getResources().getColor(R.color.text_color2));

                    } else {
                        linearLayoutsList.get(q).linearLayout.setBackgroundResource(R.drawable.unxiazhu);
                        linearLayoutsList.get(q).textViews.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                        if (null != linearLayoutsList.get(q).textView) {
                            if (!TextUtils.isEmpty(falg) || linearLayoutsList.get(q).str.equals("特码")) {
                            } else {
                                linearLayoutsList.get(q).textView.setTextColor(getContext().getResources().getColor(R.color.settingbg));
                            }
                        }
                        thecrownIndex.add(q + "");
                    }
                    yixuanzhong.setText(thecrownIndex.size() + "");
                }
            });

        }

    }


    /**
     * 关闭软键盘
     */
    private void closeKeyBoard() {
        InputMethodManager imm = (InputMethodManager) touzhued.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(touzhued.getApplicationWindowToken(), 0);

        }
    }

    public void moneychange(ResMoney resMoney) {
        tvmoney.setText(resMoney.data.balance + "");
        Info.user.money = resMoney.data.balance + "";
    }

    /**
     * 下注成功
     */
    public void betsuccses() {
        Toast.makeText(getContext(), "下注成功", Toast.LENGTH_SHORT).show();
        for (Viewbean q : linearLayoutsList) {
            q.linearLayout.setBackgroundResource(R.drawable.betting_backgroud);
            if (null != q.textView) {
                q.textView.setTextColor(getContext().getResources().getColor(R.color.blank));
            }
            q.textViews.setTextColor(getContext().getResources().getColor(R.color.text_color));
            thecrownIndex.remove(q + "");
        }
        thecrownIndex.clear();
        yixuanzhong.setText(thecrownIndex.size() + "");
        keybord.setVisibility(View.GONE);
        //请求余额刷新
        if (null != Info.user) {
            mPresenter.getmoney(Info.user.token);
        }
//        touzhued.setText("");
    }

    //token过期
    public void restartlogin() {
        Info.user = null;
        SpUtils.clearUser(getContext());
        ((BaseActivity) getActivity()).startLogin();
    }

    /////////////////////////////////////////////////////////////////////////////
    class Adapter extends RecyclerView.Adapter<Adapter.MViewHolder>
            implements OnItemClickListener {
        @Override
        public MViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            return new MViewHolder(LayoutInflater.from(getContext())
                    .inflate(R.layout.game_popitem, parent, false));

        }

        @Override
        public void onBindViewHolder(final MViewHolder holder, final int position) {
            holder.geme_tv.setText("【" + betBean_title1[position] + "-" + betBean_text1[position] + "】");
            holder.geme_tv1.setText("@" + betBean_odds1[position] + "×" + betBean_money1[position]);

            if (position + 1 == thecrownIndex.size()) {
                SYSOUtils.sOut_(position + "+++++++++++++++++++++++++++++++++++++++++++++++" + thecrownIndex.size());
                holder.game_pop_botton.setVisibility(View.VISIBLE);
                holder.game_pop_bottonlin.setVisibility(View.VISIBLE);
                holder.leftmoney.setText(position + 1 + "");
                holder.rightmoney.setText((position + 1) * Long.parseLong(betBean_money1[0]) + "");
            } else {
                holder.game_pop_botton.setVisibility(View.GONE);
                holder.game_pop_bottonlin.setVisibility(View.GONE);
            }
        }

        @Override
        public int getItemCount() {
            return thecrownIndex.size();
        }

        @Override
        public void onItemClick(View view, int position) {

        }

        class MViewHolder extends RecyclerView.ViewHolder {
            TextView geme_tv, leftmoney, rightmoney;
            TextView geme_tv1;
            View game_pop_bottonlin;
            LinearLayout game_pop_botton;

            MViewHolder(View itemView) {
                super(itemView);
                geme_tv = (TextView) itemView.findViewById(R.id.gamepoptext);
                geme_tv1 = (TextView) itemView.findViewById(R.id.gamepoptext1);
                leftmoney = (TextView) itemView.findViewById(R.id.leftmoney);
                rightmoney = (TextView) itemView.findViewById(R.id.rightmoney);
                game_pop_bottonlin = (View) itemView.findViewById(R.id.game_pop_bottonlin);
                game_pop_botton = (LinearLayout) itemView.findViewById(R.id.game_pop_botton);

            }
        }
    }

    //pc蛋蛋
    public void pcdandan(ResGameDetails resGameDetails) {
        GameDetailActivityFinal.webvideo = resGameDetails.data.videoUrl;
//        webvideo = resGameDetails.data.videoUrl;
        ivtext4.setVisibility(View.GONE);
        ivtext5.setVisibility(View.GONE);
        ivtext6.setVisibility(View.GONE);
        ivtext7.setVisibility(View.GONE);
        ivtext8.setVisibility(View.GONE);
        dataid = String.valueOf(resGameDetails.data.issue);
        pcdandanUpTv.setText(resGameDetails.data.preIssue + "期");
        periodDownTv.setText(resGameDetails.data.issue + "期");
        SYSOUtils.sOut_(resGameDetails.data.preNum);
        startleftTime(resGameDetails.data.endTime, resGameDetails.data.serverTime);
        startrightTime(resGameDetails.data.lotteryTime, resGameDetails.data.serverTime, 1);
        String[] strarray = resGameDetails.data.preNum.split(",");
        pcdandanOne.setText(strarray[0]);
        pcdandanTwo.setText(strarray[1]);
        pcdandanThree.setText(strarray[2]);
        int a = Integer.parseInt(strarray[0]) + Integer.parseInt(strarray[1]) + Integer.parseInt(strarray[2]);
        pcdandanFiv.setText(a + "");
        ivtext1.setText(a + "");
        if (a > 13) {
            ivtext2.setText("大");
        } else {
            ivtext2.setText("小");
        }
        if (a % 2 == 0) {
            ivtext3.setText("双");
        } else {
            ivtext3.setText("单");
        }
        if (!TextUtils.isEmpty(resGameDetails.data.issue.toString()) && !TextUtils.isEmpty(resGameDetails.data.preIssue.toString())) {
            long b = Long.parseLong(resGameDetails.data.issue.toString()) - Long.parseLong(resGameDetails.data.preIssue.toString());
            if (b != 1 && b < 3) {
                mPresenter.getgamesdetail1(gameid);
                return;
            }
        }
        //请求余额刷新
        if (null != Info.user) {
            mPresenter.getmoney(Info.user.token);
        }

    }   //pc蛋蛋

    public void pcdandan1(ResGameDetails resGameDetails) {
        GameDetailActivityFinal.webvideo = resGameDetails.data.videoUrl;
//        webvideo = resGameDetails.data.videoUrl;
        ivtext4.setVisibility(View.GONE);
        ivtext5.setVisibility(View.GONE);
        ivtext6.setVisibility(View.GONE);
        ivtext7.setVisibility(View.GONE);
        ivtext8.setVisibility(View.GONE);
        dataid = String.valueOf(resGameDetails.data.issue);
        pcdandanUpTv.setText(resGameDetails.data.preIssue + "期");
        periodDownTv.setText(resGameDetails.data.issue + "期");

        if (!TextUtils.isEmpty(resGameDetails.data.issue.toString()) && !TextUtils.isEmpty(resGameDetails.data.preIssue.toString())) {
            long b = Long.parseLong(resGameDetails.data.issue.toString()) - Long.parseLong(resGameDetails.data.preIssue.toString());
            if (b != 1 && b < 3) {
                if (timer1 != null) {
                    timer1.cancel();
                    timer1 = null;
                }
                if (timer2 != null) {
                    timer2.cancel();
                    timer2 = null;
                }
                mPresenter.getgamesdetail(gameid);
                return;
            }
        }
        SYSOUtils.sOut_(resGameDetails.data.preNum);
//        startleftTime(resGameDetails.data.endTime, resGameDetails.data.serverTime);
//        startrightTime(resGameDetails.data.lotteryTime, resGameDetails.data.serverTime, 1);
        String[] strarray = resGameDetails.data.preNum.split(",");
        pcdandanOne.setText(strarray[0]);
        pcdandanTwo.setText(strarray[1]);
        pcdandanThree.setText(strarray[2]);
        int a = Integer.parseInt(strarray[0]) + Integer.parseInt(strarray[1]) + Integer.parseInt(strarray[2]);
        pcdandanFiv.setText(a + "");
        ivtext1.setText(a + "");
        if (a >= 13) {
            ivtext2.setText("大");
        } else {
            ivtext2.setText("小");
        }
        if (a % 2 == 0) {
            ivtext3.setText("双");
        } else {
            ivtext3.setText("单");

        }


    }

    CountDownTimer timer1;
    CountDownTimer timer2;

    //封盘倒计时
    public void startleftTime(final String startTime, final String nowTime) {
        String mStartTile = startTime;
        String mNowTile = nowTime;
        Date startDate = DateUtils.strToDateLong(mStartTile);
        Date nowDate = DateUtils.strToDateLong(mNowTile);
        final long diff1 = startDate.getTime() - nowDate.getTime() + 500;
        if (diff1 - 500 > 0) {
            timer1 = new CountDownTimer(diff1, 1000) {
                @Override
                public void onTick(long millisUntilFinished) {
                    xiazhubt.setEnabled(true);
                    chongzhibt.setEnabled(true);
                    touzhued.setEnabled(true);
                    fengpanlin.setVisibility(View.GONE);
                    closeTimeTv.setText(TimeTools.getCountTimeByLong(millisUntilFinished));
                }

                @Override
                public void onFinish() {
                    if (timer1 != null) {
                        timer1.cancel();
                    }
                    closeTimeTv.setText(String.valueOf("已封盘"));
                    fengpanlin.setVisibility(View.VISIBLE);
                    keybord.setVisibility(View.GONE);
                    xiazhubt.setEnabled(false);
                    chongzhibt.setEnabled(false);
                    touzhued.setEnabled(false);
                }
            };
            timer1.start();
        }
    }


    public void startrightTime(final String startTime, final String nowTime, final int a) {
        String mStartTile = startTime;
        String mNowTile = nowTime;
        Date startDate = DateUtils.strToDateLong(mStartTile);
        Date nowDate = DateUtils.strToDateLong(mNowTile);
        final long diff = startDate.getTime() - nowDate.getTime() + 500;
        if (diff - 500 > 0) {
            timer2 = new CountDownTimer(diff, 1000) {
                @Override
                public void onTick(long millisUntilFinished) {
                    openTimeTv.setText(TimeTools.getCountTimeByLong(millisUntilFinished));
                    if (TimeTools.getCountTimeByLong(millisUntilFinished).equals("00:00:00")) {
                        openTimeTv.setText("开奖中");
                    }
                }

                @Override
                public void onFinish() {
                    if (timer2 != null) {
                        timer2.cancel();
                    }
                    openTimeTv.setText("开奖中");
                    SystemClock.sleep(2000);//休眠2秒，保证可以获取到最新的开奖数据
                    mPresenter.getgamesdetail(gameid);
                    //接着请求钱的接口
                }
            };
            timer2.start();
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (timer1 != null) {
            timer1.cancel();
            timer1 = null;
        }
        if (timer2 != null) {
            timer2.cancel();
            timer2 = null;
        }

    }
}

